package com.yangzehan.workbench.service.impl;


import com.yangzehan.workbench.dao.DicTypedao;
import com.yangzehan.workbench.dao.DicValuedao;
import com.yangzehan.workbench.domain.DicType;
import com.yangzehan.workbench.domain.DicValue;
import com.yangzehan.workbench.service.DicService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.lang.reflect.MalformedParameterizedTypeException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class DicServiceImpl implements DicService {
    @Resource
    private DicTypedao dicTypedao;
    @Resource
    private DicValuedao dicValuedao;
    @Override
    public Map<String, List<DicValue>> getAll() {
        Map<String, List<DicValue>>map=new HashMap<>();
        List<DicType>list=dicTypedao.getType();
        System.out.println(list);
        System.out.println("111111");
        for (DicType dt:list
             ) {  String Code=dt.getCode();
            List<DicValue> dicValueList=dicValuedao.getByID(Code);
            map.put(Code+"list",dicValueList);
        }


return  map;
    }
}
